package model;

import javax.swing.JOptionPane;

public class Client {
	private String nomClient,
					prenomClient,
					adresse;
	private String noTel;
	
	public Client(){
		super();
	}
	
	public Client(String nom, String prenom){
		nomClient = nom;
		prenomClient = prenom;
	}
	
	public void setNom(String nom){
		nomClient = nom;
	}
	
	public void setPrenom(String prenom){
		prenomClient = prenom;
	}
	
	public void setAdresse(String adresse){
		this.adresse = adresse;
	}
	
	public boolean setTelephone(String telephone){
		if (telephone.matches("-?\\d+(.\\d+)?")) {
			noTel = telephone;
			return true;
		}
		else {
			JOptionPane.showMessageDialog(null, "Le numero de telephone est invalide", "Attention", JOptionPane.ERROR_MESSAGE);
		}
		return false;
	}
	
	public String getIDClient(){
		return "" + prenomClient + nomClient + noTel;
	}
	
	public String getPrenom(){
		return prenomClient;
	}
	
	public String getNom(){
		return nomClient;
	}
	
	public String getAdresse(){
		return adresse;
	}
	
	public String getTelephone(){
		return noTel;
	}
}
